import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex);

const store = new Vuex.Store({
    state :{
      count:1,
      accesstoken:'16cc0a71-db32-4988-987c-650f618d9074'
    },
    getters:{
      getStateCount:function (state) {
        return state.count + 5
      }
    },
    mutations:{
      add:function (state) {
        state.count = state.count + 1
      },
      reduce:function (state){
        state.count = state.count - 1
      }
    },
    actions:{
      addFun (context){
        context.commit('add')
      },
      reduceFun (context){
        context.commit('reduce')
      }
    }
})

export default store
